/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Merlion.MRP.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

@Entity
public class UnplannedDailyDemandEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private int quantity;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date executionDate;
    @ManyToOne
    private PlannedDailyDemandEntity pdd;
    private boolean deleteFlag;
    private boolean committed;
    private boolean procured;
    @OneToOne(mappedBy = "unplannedDailyDemand")
    private ReservationEntity reservation;
    @OneToOne(mappedBy = "unplannedDailyDemand")
    private UnplannedMaterialRequirementEntity unplannedMaterialRequirementEntity;

    public UnplannedDailyDemandEntity(PlannedDailyDemandEntity pdd, int quantity) {
        this.quantity = quantity;
        this.pdd = pdd;
        this.executionDate = pdd.getExecDate();
        this.deleteFlag = false;
        this.committed = false;
        this.procured = false;
    }

    public UnplannedDailyDemandEntity() {
        this.deleteFlag = false;
        this.committed = false;
    }

    public Date getExecutionDate() {
        return executionDate;
    }

    public void setExecutionDate(Date executionDate) {
        this.executionDate = executionDate;
    }

    public PlannedDailyDemandEntity getPdd() {
        return pdd;
    }

    public void setPdd(PlannedDailyDemandEntity pdd) {
        this.pdd = pdd;
    }

    public UnplannedMaterialRequirementEntity getUnplannedMaterialRequirementEntity() {
        return unplannedMaterialRequirementEntity;
    }

    public void setUnplannedMaterialRequirementEntity(UnplannedMaterialRequirementEntity unplannedMaterialRequirementEntity) {
        this.unplannedMaterialRequirementEntity = unplannedMaterialRequirementEntity;
    }

    public boolean isProcured() {
        return procured;
    }

    public void setProcured(boolean procured) {
        this.procured = procured;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public boolean isCommitted() {
        return committed;
    }

    public void setCommitted(boolean committed) {
        this.committed = committed;
    }

    public PlannedDailyDemandEntity getPlannedDailyDemandEntity() {
        return pdd;
    }

    public void setPlannedDailyDemandEntity(PlannedDailyDemandEntity pdd) {
        this.pdd = pdd;
    }

    public ReservationEntity getReservation() {
        return reservation;
    }

    public void setReservation(ReservationEntity reservation) {
        this.reservation = reservation;
    }

    public boolean isDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(boolean deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    
    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
}
